// <copyright file="CmsStatus.cs" company="Clever Software">
// Copyright (c) 2013, 2014 All Right Reserved, http://www.cleversoftware.by
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Clever Software</author>
// <email>info@cleversoftware.by</email>
// <date>2014-02-04</date> 
// <summary>CleverCMS source code</summary>

//All propertiex should be virtual according http://msdn.microsoft.com/en-us/library/dd468057.aspx

namespace CleverCMS.Cms.Data.Entities
{
    using System.ComponentModel.DataAnnotations.Schema;

    public class CmsStatus : CmsObject
    {
        public CmsStatus()
        { }

        public CmsStatus(StatusCode statusCode)
        {
            Id = (int)statusCode;
            StatusCode = statusCode;
        }

        [NotMapped]
        protected StatusCode StatusCode { get; set; }

        public virtual string StatusName { get; set; }
        public virtual string Description { get; set; }

        public override string ToString()
        {
            return StatusCode.ToString();
        }
    }

    public enum StatusCode
    {
        Draft = 1,
        Published = 2,
        Dropped = 3
    }

    public class DraftStatus : CmsStatus
    {
        public DraftStatus() : base(StatusCode.Draft)
        {
        }
    }

    public class PublishedStatus : CmsStatus
    {
        public PublishedStatus() : base(StatusCode.Published)
        {
        }
    }

    public class DroppedStatus : CmsStatus
    {
        public DroppedStatus() : base(StatusCode.Dropped)
        {
        }
    }
}